#include "virtio_common.h"

static uint32_t ptIoCb_GetHostFeatures(void *pvState)
{
	return 0;
}

static uint32_t ptIoCb_GetHostMinimalFeatures(void *pvState)
{
	return 0;
}

static void ptPrintFeatures(PMyState pThis, uint32_t fFeatures, const char *pcszText)
{
	return;
}

static void ptIoCb_SetHostFeatures(void *pvState, uint32_t fFeatures)
{
	return;
}

static int ptIoCb_GetConfig(void *pvState, uint32_t offCfg, uint32_t cb, void *data)
{
	return 0;
}

static int ptIoCb_SetConfig(void *pvState, uint32_t offCfg, uint32_t cb, void *data)
{
	return 0;
}

static int ptIoCb_Reset(void *pvState)
{
	PMyState pThis = (PMyState)pvState;
	vpciReset(&pThis->VPCI);
	return 0;
}

static void ptIoCb_Ready(void *pvState)
{
	return;
}

/**
 * I/O port callbacks.
 */
static const VPCIIOCALLBACKS g_IOCallbacks =
{
	 ptIoCb_GetHostFeatures,
	 ptIoCb_GetHostMinimalFeatures,
	 ptIoCb_SetHostFeatures,
	 ptIoCb_GetConfig,
	 ptIoCb_SetConfig,
	 ptIoCb_Reset,
	 ptIoCb_Ready,
};


/**
 * @callback_method_impl{FNIOMIOPORTIN}
 */
int ptIOPortIn(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT port, uint32_t *pu32, unsigned cb)
{
	int rc = vpciIOPortIn(pDevIns, pvUser, port, pu32, cb, &g_IOCallbacks);
	return rc;
}


/**
 * @callback_method_impl{FNIOMIOPORTOUT}
 */
int ptIOPortOut(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT port, uint32_t u32, unsigned cb)
{
	int rc = vpciIOPortOut(pDevIns, pvUser, port, u32, cb, &g_IOCallbacks);
	return rc;
}
